/*
 * @Author: 耿远风
 * @Date: 2020-07-02 23:31:00
 * @LastEditors: 耿远风
 * @LastEditTime: 2020-10-15 16:50:52
 * @Description: 
 */
import { BaseModel } from '../../base/base/BaseModel';
import { prop } from 'typegoose';

export enum Gender {
    unknown = 0,
    male = 1,
    female = 2,
}
export enum UserType {
    student = 1,
    admin = 2,
}

export class UserModel extends BaseModel {
    // 手机号码
    @prop({default:''}) phone: string;

    @prop({default:''}) passWord: string;

    // 微信登录
    @prop() openId: string;

    @prop() nickName: string;

    @prop() face: string;

    // 性别
    @prop({ default: Gender.unknown })
    gender: Gender;

    @prop({default:UserType.student})
    userType:UserType;

    @prop() country: string;

    @prop() province: string;

    @prop() city: string;

    @prop() language: string;

    // 生日
    @prop() birthday: string;
}
export const User = new UserModel().getModelForClass(UserModel, {
    schemaOptions: {
        timestamps: true,
        versionKey: false,
    },
});
